[SPARK-30829][SQL] Define LegacyBehaviorPolicy enumeration as the common value for result change configs#27579
[SPARK-30829][SQL] Define LegacyBehaviorPolicy enumeration as the common value for result change configs#27579xuanyuanking wants to merge 3 commits intoapache:masterfrom
Conversation
|
cc @viirya @dongjoon-hyun @cloud-fan |
|
yea this looks clearer, +1 |
|
|
||
| val LEGACY_CTE_PRECEDENCE_ENABLED = buildConf("spark.sql.legacy.ctePrecedence.enabled") | ||
| object LegacyBehaviorPolicy extends Enumeration { | ||
| val EXCEPTION, LEGACY, NEW_BEHAVIOR = Value |
There was a problem hiding this comment.
NEW_BEHAVIOR sounds not a good name. INNER_FIRST?
There was a problem hiding this comment.
Thanks for the advice @viirya. Yes, both INNER_FIRST and INNER_PRECEDENCE are more accurate in this PR, but I also want to make this enum as a common config value, which can be reused in other similar issues. WDYT?
There was a problem hiding this comment.
how about CORRECTED to indicate that it's the corrected behavior?
|
+1 this is better. |
| s"Please set ${LEGACY_CTE_PRECEDENCE_ENABLED.key} to false so that name defined " + | ||
| "in inner CTE takes precedence. See more details in SPARK-28228.") | ||
| s"Please set ${LEGACY_CTE_PRECEDENCE_POLICY.key} to NEW_BEHAVIOR so that name " + | ||
| "defined in inner CTE takes precedence. See more details in SPARK-28228.") |
There was a problem hiding this comment.
since it's enum now, maybe also explain what will happen if set it to legacy.
|
Test build #118414 has finished for PR 27579 at commit
|
| "false, inner CTE definitions take precedence. The default value is empty, " + | ||
| .doc("When LEGACY, outer CTE definitions takes precedence over inner definitions. If set to " + | ||
| "CORRECTED, inner CTE definitions take precedence. The default value is EXCEPTION, " + | ||
| "AnalysisException is thrown while name conflict is detected in nested CTE.") |
There was a problem hiding this comment.
let's add one more sentence: This config will be removed in future versions and CORRECTED will be the only behavior.
| @@ -1,2 +1,2 @@ | |||
| --SET spark.sql.legacy.ctePrecedence.enabled = false | |||
| --SET spark.sql.legacy.ctePrecedencePolicy = new_behavior | |||
|
Test build #118542 has finished for PR 27579 at commit
|
|
Test build #118565 has finished for PR 27579 at commit
|
|
thanks, merging to master/3.0! |
…mon value for result change configs ### What changes were proposed in this pull request? Define a new enumeration `LegacyBehaviorPolicy` in SQLConf, it will be used as the common value for result change configs. ### Why are the changes needed? During API auditing for the 3.0 release, we found several new approaches that will change the results silently. For these features, we need a common three-value config. ### Does this PR introduce any user-facing change? Yes, original config `spark.sql.legacy.ctePrecedence.enabled` change to `spark.sql.legacy.ctePrecedencePolicy`. ### How was this patch tested? Existing UT. Closes #27579 from xuanyuanking/SPARK-30829. Authored-by: Yuanjian Li <xyliyuanjian@gmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com> (cherry picked from commit e4a541b) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
|
Thanks for the review. |
…l.legacy.ctePrecedencePolicy` ### What changes were proposed in this pull request? Fix the migration guide document for `spark.sql.legacy.ctePrecedence.enabled`, which is introduced in #27579. ### Why are the changes needed? The config value changed. ### Does this PR introduce any user-facing change? No. ### How was this patch tested? Document only. Closes #27782 from xuanyuanking/SPARK-30829-follow. Authored-by: Yuanjian Li <xyliyuanjian@gmail.com> Signed-off-by: HyukjinKwon <gurwls223@apache.org>
…l.legacy.ctePrecedencePolicy` ### What changes were proposed in this pull request? Fix the migration guide document for `spark.sql.legacy.ctePrecedence.enabled`, which is introduced in #27579. ### Why are the changes needed? The config value changed. ### Does this PR introduce any user-facing change? No. ### How was this patch tested? Document only. Closes #27782 from xuanyuanking/SPARK-30829-follow. Authored-by: Yuanjian Li <xyliyuanjian@gmail.com> Signed-off-by: HyukjinKwon <gurwls223@apache.org> (cherry picked from commit f7f1948) Signed-off-by: HyukjinKwon <gurwls223@apache.org>
…mon value for result change configs ### What changes were proposed in this pull request? Define a new enumeration `LegacyBehaviorPolicy` in SQLConf, it will be used as the common value for result change configs. ### Why are the changes needed? During API auditing for the 3.0 release, we found several new approaches that will change the results silently. For these features, we need a common three-value config. ### Does this PR introduce any user-facing change? Yes, original config `spark.sql.legacy.ctePrecedence.enabled` change to `spark.sql.legacy.ctePrecedencePolicy`. ### How was this patch tested? Existing UT. Closes apache#27579 from xuanyuanking/SPARK-30829. Authored-by: Yuanjian Li <xyliyuanjian@gmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
…l.legacy.ctePrecedencePolicy` ### What changes were proposed in this pull request? Fix the migration guide document for `spark.sql.legacy.ctePrecedence.enabled`, which is introduced in apache#27579. ### Why are the changes needed? The config value changed. ### Does this PR introduce any user-facing change? No. ### How was this patch tested? Document only. Closes apache#27782 from xuanyuanking/SPARK-30829-follow. Authored-by: Yuanjian Li <xyliyuanjian@gmail.com> Signed-off-by: HyukjinKwon <gurwls223@apache.org>
What changes were proposed in this pull request?
Define a new enumeration
LegacyBehaviorPolicyin SQLConf, it will be used as the common value for result change configs.Why are the changes needed?
During API auditing for the 3.0 release, we found several new approaches that will change the results silently. For these features, we need a common three-value config.
Does this PR introduce any user-facing change?
Yes, original config
spark.sql.legacy.ctePrecedence.enabledchange tospark.sql.legacy.ctePrecedencePolicy.How was this patch tested?
Existing UT.